In a client/server model, unless a user logs in to an application server and provides its Internet Protocol (IP) address to the application server, the application server is unable to actively find a user terminal and send information to the user terminal. Therefore, a Push technology is developed.
The Push technology is a technology that allows an application server to actively send information to a client based on a client/server mechanism. To be specific, the Push transaction is initiated by the application server, and the user is not required to log in to the application server beforehand. The Push technology in essence is to let information actively find a user, and its advantage lies in active and timely information. By using this technology, information may be pushed to a user equipment as quickly as possible.
At present, Apple, Inc. launches a Push Notification solution applied to i-phones. The solution uses the Push technology. When an application of the user has an incoming event (for example, a new email is received), the event is directly pushed to the client, and the client is not required to keep the application online or periodically log in to the application server to see whether any new event occurs. The working process of the Push Notification solution may be summarized as follows:
1. The application server packetizes an application message to be sent and the identifier of a destination i-phone into a Notification message and sends the Notification message to a Push server.
2. The Push server finds the IP address of the destination i-phone in a list of i-phones that have registered the Push service, converts the Notification message into a Push message, and sends the Push message to the destination i-phone.
3. The destination i-phone transfers the received Push message to a corresponding client application and pops up a Push notification according to the setting.
The identifier of a destination i-phone is the basis for the Push server to judge to which i-phone the Push message should be sent. This identifier is known as a device token. After network entry, the i-phone establishes a permanent IP connection with the Push server. After the connection is established, the i-phone registers with the Push server, the Push server sends the device token to the i-phone, and the i-phone sends the device token to the application server through the client application. Later, if the application server needs to send an application message to the i-phone, the application server sends the corresponding device token and the application message together to the Push server, and then the Push server finds the corresponding destination i-phone according to the device token and sends the corresponding Push message.
When no data is transferred, a heartbeat operation is performed between the Push server and the i-phone at intervals of a dozen minutes to maintain the validity of the IP connection. In the process of establishing a connection with the i-phone, the Push server records the IP connection information, which includes the address and port of the i-phone. If network address translation (NAT) is available between the i-phone and the Push server, what is recorded by the Push server is the public IP address and port of the i-phone after NAT.
The preceding solution is unable to guarantee the validity and reachability of the IP connection. Consequently, the Push message fails to be pushed or is pushed to other terminals incorrectly, and the real-time performance and reliability of the Push message are affected.